<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div style="text-align:center">
	Fundo Programado
	<div id="fundoProgramado"></div>
	Clube XIII
	<div id="clubexiii"></div>
</div>


<script>

	var dataFinal = new Date()
	var dataInicial = new Date(dataFinal.getFullYear(), dataFinal.getMonth(), (dataFinal.getDate()-1)); 

	alert(formatDate(dataInicial));
	alert(formatDate(dataFinal));
	
	
	function formatDate(data)
	{
		return formatDigito(data.getDate()) + "/" + formatDigito((data.getMonth() + 1)) + "/" + data.getFullYear();
	}

	function formatDigito(numero) 
	{
		if (numero < 10)
			numero = "0" + numero
			
		return numero;	
	}
	
	function getTableHistoricoCotas() 
	{
		var  html = "sssssssssssssssssds sdsd<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr class='tblHeader'>	<td colspan='3'><img src='imgs/titHistoricoCotas.gif' width='106' height='21' /></td></tr><tr>	<td align='left' class='tblInfo' style='border-left:1px solid #9ea3ca; text-align:left;font-weight:bold'>Data   &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;       |</td>	<td align='left' class='tblInfo' style='text-align:left;font-weight:bold'>Cota (R$)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    |</td>	<td align='left' class='tblInfo' style='border-right:1px solid #9ea3ca; text-align:left;font-weight:bold'>Pat. Liquido (R$)</td></tr><tr>	<td align='left' class='tblInfo' style='border-left:1px solid #9ea3ca; text-align:left'>30/07/07</td>	<td align='left' class='tblInfo'>1,7517048</td>	<td align='left' class='tblInfo' style='border-right:1px solid #9ea3ca; text-align:left'>417,62M</td></tr></table>sbdvnsbdmnsvbnmdvs";
		iStartImg = html.indexOf("imgs/titHistoricoCotas.gif");
		if (iStartImg > -1) {
			iStartTable = html.lastIndexOf("<table", iStartImg);
			iEndTable = html.indexOf("</table>", iStartImg);
			if (iStartTable > -1) 
			{
				table = html.substring(iStartTable, iEndTable+8);
			}	
		}
		table = table.replace("imgs/titHistoricoCotas.gif","http://clubes.gerafuturo.com.br/clubinv/v2/imgs/titHistoricoCotas.gif");
		return table;
	}	
	
	document.getElementById('fundoProgramado').innerHTML = getTableHistoricoCotas();
	document.getElementById('clubeXIII').innerHTML = getTableHistoricoCotas();

</script>


</body>
</html>